package com.bum.app.tool.util;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang.StringUtils;

public class RequestUtil {
	public static String getPath(HttpServletRequest req) {
		String path = req.getServletPath() + StringUtils.trimToEmpty(req.getPathInfo());
		if (path != null && path.startsWith("/")) {
			return path.substring(1);
		}
		return path;
	}

	public static String getInfo(HttpServletRequest req) {
		String path = req.getPathInfo();
		if (null != path && path.length() > 0) {
			path = StringUtils.trimToNull(path.substring(1));
		}
		return path;
	}
}
